import axios from '@/utils/request'

// 获取商品列表
// /api/getgoods?pageindex=number
// params参数：pageindex: 页码
export const getGoodsList = (params) => {
    return axios({
        url: '/api/getgoods',
        params
    })
}

// id获取商品图文详情信息
// /api/goods/getdesc/:id
export const getGoodsDetial = (id) => {
    return axios({
        url: `/api/goods/getdesc/${id}`
    })
}
// id获取商品价格信息
// /api/goods/getinfo/:id
export const getGoodInfo = (id) => {
    return axios({
        method: 'get',
        url: `/api/goods/getinfo/${id}`
    })
}

export const getCarList = (id) => {
    return axios({
        method: 'get',
        url: `/api/goods/getshopcarlist/${id}`
    })
}

// 商品图片
// /api/getthumimages/:imgid
export const getImages = (id) => {
    return axios({
        method: 'get',
        url: `/api/getthumimages/${id}`
    })
}